<? 
class overzichtController extends inabuurt_controller_action{

	public function indexAction(){
	
		
		require_once('./application/models/bewonersgroepModel.php');
		
		
		$this -> view -> setTpl('bewonersgroepen_overzicht.php');
		$this -> view -> addStyle(view::PATH_TO_STYLE.'bewonersgroepen.css');
		
		$model = bewonersgroepModel::getInstance($this -> conn);
		
		
		
		
		if(!is_numeric($this -> request -> getParam(0))){
		
			if($this -> request -> getParam(1) != NULL){
			$page = $this -> request -> getParam(1);
			}else{
			$page = 0;
			}
			$list = new user_list($model -> getBewonersgroepenByFirstLetter($this -> request -> getParam(0)), 20);	
		
		}else{
		
		if($this -> request -> getParam(0) != NULL){
			$page = $this -> request -> getParam(0);
		}else{
			$page = 0;
		}
		
		$list = new user_list($model -> getBewonersgroepen(), 20);
		}
		
		$this -> view -> bewList = $list -> renderPage($page);
		
		
		$this -> view -> itemList = $list -> renderPage($page);
		
		if($list -> getNextPage() != NULL){
			
			$this -> view -> nextLink = $list -> getNextPage();
		}
		if($list -> getPrevPage() != NULL){
	
			$this -> view -> prevLink = $list -> getPrevPage();
		}
		
		
		
		$this -> view -> render();
	
	
	}





}